<style>
.weui_cell_bd {
    padding: 0;
	min-height:1.6rem;
	line-height:1.6rem;
}
.weui_cell_hd {min-width:3.7rem;padding: 0 4px;}
.weui_input {padding:0}
.weui_cell {
    padding: 0.5rem 2px;
}
</style>
<div class='fui-page fui-page-current page-commission-register'>
	<div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click='goback()'></a>
        </div>
        <div class="title">申请商户店长</div>
    </div>
	<img style="width:100%;position: relative;margin-top:2.2rem" ng-src="{{tomedia(pagedata.apply.regbg) || '../addons/jy_weishop/resource/images/agent-top.jpg'}}" />
	<div class='fui-content' style="margin-top:0">
	<div class='jy-content'>
	<div ng-if="!pagedata.member.id && !pagedata.can_apply">
		<div class='fui-list-group'>
				<div class='fui-list-group-title'><i class="icon icon-lights"></i> 友情提醒</div>
				<div class='fui-list'>
					<div ng-if="pagedata.zhaoshang.isopen !=1 && pagedata.zhaoshang.become !=2" class='fui-list-inner'>
						<div class='text'>《{{pagedata.setting.agent_title ||'商户店长'}}申请》 ，还不支持线上<span class="text-danger text-bold">申请</span></div>
					</div>
					<div ng-if="pagedata.zhaoshang.become==3" class='fui-list-inner'>
						<div class='text'>自购总部商品累计消费满 <span class="text-danger text-bold">{{pagedata.limit}}</span>{{pagedata.unit}}，
							才可成为&lt;<span class="text-danger text-bold">{{pagedata.setting.tagent || '商户店长'}}</span>&gt;购物中心{{pagedata.setting.tagent}}，您已消费 <span class="text-danger text-bold">{{pagedata.now}}</span> {{pagedata.unit}}，请继续努力！</div>
					</div>
					<div ng-if="pagedata.zhaoshang.become==4" class='fui-list-inner'>
						<div class='text'>自购指定总部商品，
							才可成为<span class="text-danger text-bold">【{{pagedata.setting.tagent || '商户店长'}}】</span>！</div>
					</div>
				</div>
		</div>
		<div ng-if="pagedata.become_goods.length>0" class="jy-group">
			<div class="fui-goods-group no {{item.total <=0?'disabled':''}}" style="padding:0;background-color:#f7f7f7">
				<div ng-repeat="item in pagedata.become_goods" class="fui-goods-item" style="padding:0;margin:0.2rem 0;border: 0px solid #e7e7e7;">
					<div ng-click="access_json('jy_weishop/goods.detail//id='+item.id);" ng-if="!item.video || pagedata.shopset.no_video==1" ng-class="{'image':1, 'echelon':item.active.title}" data-text="{{item.active.title}}" style="background-image: url({{tomedia(item.image) ||'../core/resource/images/nopic.jpg'}})">
							<div ng-show="item.total <=0" class="salez" style="background-image: url({{tomedia(pagedata.shopset.shop.saleout)}}); "></div>
					</div>
					<div ng-if="item.video && pagedata.shopset.no_video !=1" class="image">
						<video style="width:100%;height:100%;background:#999" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"
							  poster="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}"
							  data-setup='{"controls": true, "autoplay": false}'>
							  <source ng-src="{{tomedia(item.video)}}" type="video/mp4">					 
						</video>
					</div>
					<div class="detail" style="height:2.6rem;padding-left:0.3rem;padding-top:0.2rem">
						<div ng-click="access_json('jy_weishop/goods.detail//id='+item.id);" class="overflow-h" style="width:10rem">
								{{item.title}}
						</div>
						<div ng-if="!item.active.rest_time" class="subtitle overflow-h" style="width:10rem">
								{{item.subtitle || '暂时没有商品描述... ...'}}
						</div>
						<div ng-if="item.active.rest_time" class="timer" ng-init="tool.time_down(pagedata.list[$index].active.rest_time)" style="width:10rem">
								{{item.active.status==0?'距开始':'距结束'}}  <span class="time-hour">{{pagedata.list[$index].active.rest_time.hour}}</span>:<span class="time-min">{{pagedata.list[$index].active.rest_time.minute}}</span>:<span class="time-sec">{{pagedata.list[$index].active.rest_time.second}}</span>
						</div>
						<div>
							<div class="price red" style="margin-top:0.1rem">￥ 
								<span class="text">
									<span ng-if="!item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.price}}</span>
									<span ng-if="item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.active.price}}</span> /{{item.unit || '件'}}
									<span ng-if="!pagedata.pluginset.noweight && item.weight>0" style="color:#999;font-size:0.55rem;font-weight:400">({{item.weight}}kg)</span>
								</span>
								<span class="red" style="padding-right:0.5rem" href="javascript:" ng-click="access_json('jy_weishop/goods.detail//id='+item.id);"><i class="icon icon-tianmaochaoshigouwuche"></i></span>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<a ng-if="pagedata.zhaoshang.become==3 || pagedata.zhaoshang.become==4" class="btn btn-danger block" href="javascript:;" ng-click="access_json('jy_weishop/index/')">继续去购物</a>
	</div>
	<div ng-if="pagedata.member.id">
		<div ng-if="pagedata.member.status==0" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">谢谢您的支持，请等待审核！</span>
        </div>
		<div ng-if="pagedata.member.status==1" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">恭喜您，您的商户店长申请已审核通过！</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="access_json('jy_mzhaoshang/index/')">前往{{pagedata.setting.agent_center ||'招商中心'}}</a>
        </div>
		<div ng-if="pagedata.member.status==2" class='content-info' >
            <i class='icon icon-clock'></i>
            <br/><span class="">非常抱歉，您的{{pagedata.setting.agent_title ||'商户店长'}}申请被管理员拒绝！</span>
			<br/><span class="">未审核通过原因：</span>
            <br/><a class="btn btn-danger" href="javascript:;" ng-click="pagedata.applyagain=1">重新申请</a>
        </div>
	</div>
    <div ng-if="(!pagedata.member.id && pagedata.zhaoshang.isopen ==1 && pagedata.can_apply) || pagedata.applyagain" style="margin-top:0">
        <div class="weui_cells weui_cells_form" style='margin-top:0'>
            <div class="fui-cell-title"style="padding:0.5rem 0.2rem">
                欢迎加入<span class='text-danger'>{{pagedata.apply.shop_title}}</span>，请填写申请{{pagedata.setting.agent_title||'商户店长'}}信息
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd must'>姓名</div>
                <div class='weui_cell_bd weui_cell_primary'><input type="text" class='weui_input' ng-model="pagedata.item.realname" placeholder="请填写真实姓名，用于结算" /></div>
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd must'>手机号</div>
                <div class='weui_cell_bd weui_cell_primary'><input type="tel" class='weui_input' ng-model="pagedata.item.mobile" placeholder="请填写手机号码方便联系" /></div>
            </div>
            <div class='weui_cell'>
                <div class='weui_cell_hd'>微信号</div>
                <div class='weui_cell_bd weui_cell_primary'><input type="text" class='weui_input' ng-model="pagedata.item.wechat" placeholder="请填写微信号"  /></div>
            </div>
		</div>
		<div class="weui_cells_title">所属区域</div>
			<div class="weui_cells">
				<div class="weui_cell weui_cell_select" style="padding:0.3rem 0">
					<div class="weui_cell_bd weui_cell_primary">
						<select class="weui_selectpcd" ng-model="pagedata.item.area.province"  ng-change="pagedata.item.area.city=undefined;pagedata.item.area.district=undefined;pagedata.item.area.street=undefined">
							<option value="" selected="selected">省份</option>
							<option ng-repeat="(value,data) in pagedata.areas" ng-selected="pagedata.item.area.province==value"  value="{{value}}">{{value}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<select class="weui_selectpcd" ng-model="pagedata.item.area.city" ng-change="pagedata.item.area.district=undefined;pagedata.item.area.street=undefined">
							<option value="" selected="selected">城市</option>
							<option ng-repeat="(value,data) in pagedata.areas[pagedata.item.area.province]" ng-selected="pagedata.item.area.city==value" value="{{value}}">{{value}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<select class="weui_selectpcd" ng-model="pagedata.item.area.district" ng-change="pagedata.item.area.street=undefined">
							<option value="" selected="selected">区县</option>
							<option ng-repeat="(value,data) in pagedata.areas[pagedata.item.area.province][pagedata.item.area.city]" ng-selected="pagedata.item.area.district==value" value="{{value}}">{{value}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<select class="weui_selectpcd" ng-model="pagedata.item.area.street">
							<option value="" selected="selected">街道</option>
							<option ng-repeat="value in pagedata.areas[pagedata.item.area.province][pagedata.item.area.city][pagedata.item.area.district]" ng-selected="pagedata.item.area.street==value" value="{{value}}">{{value}}</option>
						</select>
					</div>
				</div>
			</div>
            <div class="fui-cell-group">
                <div class="fui-cell small ">
                    <div class="fui-cell-info">
                        <label class="checkbox-inline">
                            <input type="checkbox" class="fui fui-checkbox fui-checkbox-danger" ng-model="pagedata.item.agree" /> 我已经阅读并了解了<a id="btn-apply" ng-click="pagedata.show_content=true" style="color:#337ab7;">【{{pagedata.apply.apply_title||'注册协议'}}】</a>。
                        </label>

                    </div>
                </div>
            </div>
            <div ng-show="pagedata.show_content" class="modal-bg pop-apply-hidden" >
                <div class="modal-content" style="top:10%;width:90%;left:5%">
                    <div class="closebtn" ng-click="pagedata.show_content=false" style="opacity:1;"><i class="icon icon-cuowu"></i></div>
                    <div class="news-body">
						<div class="title">{{pagedata.apply.apply_title}} / <small>Read &nbsp;Ggree</small></div>
                        <div class="text" ng-bind-html="trust(pagedata.apply.apply_content)"></div>
                    </div>
					<div class="modal-footer">
                            <div ng-click="pagedata.show_content=false" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
                    </div>
                </div>
            </div>
        <div class='btn btn-danger block btn-submit' style="margin-top:2rem" ng-click="post(pagedata.item,'jy_mzhaoshang/apply/apply/')">申请{{pagedata.setting.agent_become||'成为商户店长'}}</div>
		</div>
	</div>
	</div>
</div>
<script type="text/javascript">
scope.pagedata.getprovince=function(){
	scope.get('core/member.set/getprovince/',function(res){
		scope.pagedata.areas=res.province;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince();
</script>
